<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>福轨综合办公门户</title>
        <link rel="stylesheet" type="text/css" href="/Public/Admin/css/simple-calendar.css"/>
        <link rel="stylesheet" type="text/css" href="/Public/Admin/css/swiper.css"/>
        <link rel="stylesheet" type="text/css" href="/Public/Admin/css/index.css"/>

        <script type="text/javascript" src="/Public/Admin/js/jquery.min.js"></script>
        <script src="/Public/Admin/js/swiper.js" type="text/javascript" charset="utf-8"></script>
        <script src="/Public/static/echarts/echarts.common.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/Public/Admin/js/simple-calendar.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" src="/Public/static/layer/layer.js" ></script>
        <script type="text/javascript" src="/Public/Admin/js/new_index.js" ></script>

        <!--日程-->
        <!--<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/main.css"/>-->
        <!--        <link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/fullcalendar.css"/>
                <link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/fancybox.css"/>-->
        <script src="/Public/static/fullcalendar/js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
        <script src="/Public/static/fullcalendar/js/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
        <script src="/Public/static/fullcalendar/js/fullcalendar.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/Public/static/fullcalendar/js/jquery.fancybox-1.3.1.pack.js" type="text/javascript" charset="utf-8"></script>
        <style>

        </style>
    </head>
    <body>
        <div class="page-index">
            <div class="headWrap">
                <div class="head clearfix">
                    <div class="logo fl">
                        <img src="/Public/Admin/images/logo.svg" />
                    </div>
                    <div class="nav fl positionR">
                        <ul>
                            <li class="active"><a href="/">首页</a></li>
                            <?php if(is_array($userMenus)): foreach($userMenus as $key=>$menu): ?><li>
                                    <a href="javascript:;"><?php echo ($menu["name"]); ?></a>
                                    <div class="subNav1">
                                        <ul>
                                            <?php if(is_array($menu["child"])): foreach($menu["child"] as $key=>$child): ?><li><a href="<?php if($child[param] != null): ?>/index.php/Home/<?php echo ($child["url"]); ?>&<?php echo ($child["param"]); else: ?>/index.php/Home/<?php echo ($child["url"]); endif; ?>"  data-url="/index.php/Home/<?php echo ($child["url"]); ?>"><?php echo ($child["name"]); ?></a></li><?php endforeach; endif; ?>
                                        </ul>
                                    </div>
                                </li><?php endforeach; endif; ?>
                            <li>
                                <a href="/">问题与建议</a>
                                <div class="subNav1">
                                    <ul>
                                        <?php if($is_handle != 1): ?><li>
                                                <a href="#" class="question">提出问题</a>
                                            </li><?php endif; ?>
                                        <li>
                                            <a href="#" class="questionList"><?php if($is_handle == 1): ?>问题列表<?php else: ?>我的问题<?php endif; ?></a>
                                        </li>
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="user fr positionR">
                        <div class="headIcon positionR">
                            <i class="iconfont">&#xe654;</i>
                            <label class="sanjiao"></label>
                            <span class="num"><?php echo ($attendCount); ?></span>
                            <div class="subInfo" id="stateBox">
                                <div class="search">
                                    <i class="iconfont">&#xe6b5;</i>
                                    <div>
                                        <input type="text" placeholder="搜索人员" class="searchUser" value="" data-url="<?php echo U(searchUser);?>"/>
                                    </div>
                                </div>
                                <ul class="default">
                                    <li class="item item-hide" state="hide">
                                        <a>
                                            <span>外出人员</span>
                                            <label class="color1"><?php echo ($outCount); ?></label>
                                            <em class="arrow"></em>
                                        </a>
                                        <dl>
                                            <?php if(is_array($outList)): foreach($outList as $key=>$out): ?><dd>
                                                    <img src="<?php echo ((isset($out["head"]) && ($out["head"] !== ""))?($out["head"]):'/Public/Admin/images/man.png'); ?>" />
                                                    <span><?php echo (getChineseName($out["user_id"])); ?></span>
                                                </dd><?php endforeach; endif; ?>
                                        </dl>
                                    </li>
                                    <li class="item item-hide" state="hide">
                                        <a>
                                            <span>出差人员</span>
                                            <label class="color3"><?php echo ($evectionCount); ?></label>
                                            <em class="arrow"></em>
                                        </a>
                                        <dl>
                                            <?php if(is_array($evectionList)): foreach($evectionList as $key=>$evection): ?><dd>
                                                    <img src="<?php echo ((isset($evection["head"]) && ($evection["head"] !== ""))?($evection["head"]):'/Public/Admin/images/man.png'); ?>" />
                                                    <span><?php echo (getChineseName($evection["user_id"])); ?></span>
                                                </dd><?php endforeach; endif; ?>
                                        </dl>
                                    </li>
                                    <li class="item item-hide" state="hide">
                                        <a>
                                            <span>请假人员</span>
                                            <label class="color2"><?php echo ($leaveCount); ?></label>
                                            <em class="arrow"></em>
                                        </a>
                                        <dl>
                                            <?php if(is_array($leaveList)): foreach($leaveList as $key=>$leave): ?><dd>
                                                    <img src="<?php echo ((isset($leave["head"]) && ($leave["head"] !== ""))?($leave["head"]):'/Public/Admin/images/man.png'); ?>" />
                                                    <span><?php echo (getChineseName($leave["user_id"])); ?></span>
                                                </dd><?php endforeach; endif; ?>
                                        </dl>
                                    </li>
                                </ul>
                                <ul class="search-ul hide"></ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main clearfix">
                <div class="left">
                    <div class="section1 clearfix">
                        <div class="fl dayInfo">
                            <div class="box1">
                                <p class="time positionR"><font class="time2" style="color:#fff"></font><span class="en-time">AM</span></p>
                                <p class="date">2018-08-01</p>
                            </div>
                            <div class="box2">
                                <i class="iconfont fl">&#xe678;</i>
                                <div class="fl watherMore">
                                    <span class="wt">多云</span>
                                    <label class="c">28-35℃</label>
                                </div>
                            </div>
                            <div class="after hide">
                                <ul>
                                </ul>
                            </div>
                        </div>
                        <div class="userInfo fl">
                            <div class="box3 claerfix">
                                <img src="<?php if($userinfo[head_url] != null): echo ((isset($userinfo["head_url"]) && ($userinfo["head_url"] !== ""))?($userinfo["head_url"]):'/Public/Admin/images/man.png'); else: echo ((isset($userinfo["head"]) && ($userinfo["head"] !== ""))?($userinfo["head"]):'/Public/Admin/images/man.png'); endif; ?>" />
                                <div class="box31 displayIB">
                                    <span class="disB"><?php echo ($userinfo["user_name"]); ?></span>
                                    <label class="disB"><?php echo (getDeptName($userinfo["dept_id"])); ?></label>
                                </div>
                                <div class="box32 fr positionR">
                                    <a href="<?php echo U('Flow/lists',array('type'=>1));?>">
                                        <i class="iconfont">&#xe642;</i>
                                        <span><?php echo ($runCount); ?></span>
                                        <label>待办流程</label>
                                    </a>
                                </div>
                            </div>
                            <div class="box4" id="box4" style="position:relative">
                                <div class="online">
                                    <a class="pointer onlineUser"><span>在线</span></a>
                                    <label>(在线人数<?php echo ($onlineCount); ?>)</label>
                                    <a class="exit pointer" title="退出" href="<?php echo U('Login/logout');?>"><i class="iconfont fr iconfont1">&#xe61a;</i></a>
                                    <i class="iconfont fr iconfont2 setting">&#xe729;</i>
                                </div>
                                <div class="onlineList hide">
                                    <ul>
                                        <?php if(is_array($onlineUser)): foreach($onlineUser as $key=>$user): ?><li><img src="<?php echo ((isset($user["head"]) && ($user["head"] !== ""))?($user["head"]):'/Public/Admin/images/man.png'); ?>" width="30px"><span>[<?php echo (getDeptName($user["dept_id"])); ?>] <?php echo ($user["user_name"]); ?></span></li><?php endforeach; endif; ?>
                                    </ul>
                                </div>
                                <p>上次登录：<?php echo ($userinfo["last_visit_time"]); ?><p>
                            </div>
                        </div>
                    </div>
                    <div class="section section2">
                        <h3 class="title"><span class="active">快速导航</span></h3>
                        <ul class="clearfix">
                            <?php if(is_array($qNavs)): foreach($qNavs as $key=>$nav): if($nav['url'] == '#'): ?><li><span><i class="iconfont" style="color:#999;cursor: none">&<?php echo ($nav["nav_icon"]); ?></i><p><?php echo ($nav["nav_name"]); ?></p></span></li>
                                    <?php else: ?>
                                    <li><a href="/index.php/Home/<?php echo ($nav["url"]); ?>"><i class="iconfont">&<?php echo ($nav["nav_icon"]); ?></i><p><?php echo ($nav["nav_name"]); ?></p></a></li><?php endif; endforeach; endif; ?>
                        </ul>
                    </div>
                    <div class="section section3">
                        <h3 class="title">
                            <a href="<?php echo U('Personal/schedule');?>"><span class="active fl">我的日历</span></a>
                            <a class="inseartEvent pointer"><i class="iconfont">&#xe638;</i>新增日程</a>
                            <a href="javascript:;" class="fr writeLog"><i class="iconfont">&#xe684;</i>写日志</a></h3>
                        <div id='container'></div>
                        <ul class="remindList" style="overflow: auto;height:93px">
                            <?php if(!empty($calendars)): if(is_array($calendars)): foreach($calendars as $key=>$calendar): ?><li class="clearfix">
                                        <a href="javascript:;" title="<?php echo ($calendar["content"]); ?>">
                                        <i class="iconfont remindIcon">&#xe6c6;</i>
                                        <label><?php echo (date("m-d H:i",$calendar["remind_time"])); ?></label>
                                        <span><?php echo ($calendar["title"]); ?></span>
                                        <div class="fr operation">
                                            <i class="iconfont deliconfont delete" data-url="<?php echo U('Personal/delCalendar',array('id'=>$calendar['id']));?>">&#xe698;</i>
                                            <i class="iconfont inseartEvent" data-id="<?php echo ($calendar["id"]); ?>">&#xe636;</i>
                                        </div>
                                    </a>
                                </li><?php endforeach; endif; ?>
                                <?php else: ?>
                                <li class="clearfix">暂无日程</li><?php endif; ?>
                        </ul>
                    </div>
                </div>
                <div class="middle">
                    <div class="section section6">
                        <h3 class="title" id="newsBox">
                            <span class="active" data-url="<?php echo U('Personal/news');?>">公司新闻</span>
                            <span data-url="<?php echo U('Personal/news');?>">新闻列表</span>
                            <span data-url="<?php echo U('Personal/notice');?>">公告通知</span>
                            <a href="<?php echo U('Personal/news');?>"  title="更多"><i class="iconfont fr">&#xe61b;</i></a>
                        </h3>
                        <div class="tabBox">
                            <div class="listBox">
                                <div class="list newsBanner positionR">
                                    <div class="swiper-container" style="height: 200px;">
                                        <div class="swiper-wrapper">
                                            <?php if(is_array($imgNews)): foreach($imgNews as $key=>$imgNew): ?><div class="swiper-slide positionR"><a href="<?php echo U('Personal/readNews',array('news_id'=>$imgNew['news_id']));?>"><img src="<?php echo ($imgNew["uploads_url"]); ?>" /><p><span><?php echo ($imgNew["subject"]); ?></span></p></a></div><?php endforeach; endif; ?>
                                        </div>
                                        <div class="pagination"></div>
                                    </div>
                                </div>
                                <ul class="list" style="display: none;">
                                    <?php if(is_array($news)): foreach($news as $key=>$new): ?><li class="clearfix">
                                            <a href="<?php echo U('Personal/readNews',array('news_id'=>$new['news_id']));?>" title="<?php echo ($new["subject"]); ?>">
                                                <div class="content"><?php if($new['noRead'] == 1): ?><span class="dotted"></span><?php endif; echo ($new["subject"]); ?> </div><span class="time fr"><?php echo ($new["news_time"]); ?></span>
                                            </a>
                                        </li><?php endforeach; endif; ?>
                                </ul>
                                <ul class="list" style="display: none;">
                                    <?php if(is_array($notifys)): foreach($notifys as $key=>$notify): ?><li class="clearfix">
                                            <a href="<?php echo U('Personal/readNotify',array('notify_id'=>$notify['notify_id']));?>" title="<?php echo ($notify["subject"]); ?>">
                                                <div class="content"><?php if($notify['noRead'] == 1): ?><span class="dotted"></span><?php endif; echo ($notify["subject"]); ?> </div><span class="time fr"><?php echo ($notify["audit_date"]); ?></span>
                                            </a>
                                        </li><?php endforeach; endif; ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="section section4">
                        <h3 class="title">
                            <span class="active">待办事项</span>
                            <a href="<?php echo U('Flow/lists',array('type'=>1));?>" title="更多"><i class="iconfont fr">&#xe61b;</i></a>
                        </h3>
                        <div class="tabBox">
                            <ul class="clearfix navList">
                                <li class="active" data-url="<?php echo U('Flow/lists',array('type'=>1));?>">流程待办</li>
                                <li data-url="<?php echo U('Plan/index',array('sms_flag'=>0,'type'=>4));?>">计划待办</li>
                                <li data-url="#">其他待办</li>
                            </ul>
                            <div class="listBox">
                                <ul class="list">
                                    <?php if(!empty($runs)): if(is_array($runs)): foreach($runs as $key=>$run): ?><li class="clearfix">
                                                <a href="<?php echo U('Flow/form',array('id'=>$run['flow_type']['form_id'],'flow_id'=>$run['flow_id'],'run_id'=>$run['run_id'],'currPrcs'=>$run['currPrcs']));?>" title="<?php echo ($run["run_name"]); ?>">
                                                    <div class="dbcont content">
                                                        <?php if($key == 0): ?><span class="tj workLabel">特急</span>
                                                            <?php elseif($key < 3): ?>
                                                            <span class="j workLabel">急</span><?php endif; ?>
                                                        <?php echo ($run["run_name"]); ?> (<?php echo (getChineseName($run["begin_user"])); ?>)</div><span class="time fr"><?php echo ($run["date"]); ?></span>
                                                </a>
                                            </li><?php endforeach; endif; ?>
                                        <?php else: ?>
                                        <li class="clearfix">
                                            <a href="javascript:;">
                                                <label class="dbcont content">暂无待办流程 </label><span class="time fr"></span>
                                            </a>
                                        </li><?php endif; ?>
                                </ul>
                                <ul class="list" style="display: none;">
                                    <?php if(!empty($plans)): if(is_array($plans)): foreach($plans as $key=>$plan): ?><li class="clearfix">
                                                <a href="<?php echo U('Plan/show',array('id'=>$plan['plan_id'],'type'=>4,'sms_flag'=>0));?>" title="<?php echo ($plan["name"]); ?>">
                                                    <div class="dbcont content"><?php echo ($key+1); ?>. [<?php echo (getPlanType($plan["type"])); ?>] <?php echo ($plan["name"]); ?> </div><span class="time fr"><?php echo ($plan["begin_date"]); ?></span>
                                                </a>
                                            </li><?php endforeach; endif; ?>
                                        <?php else: ?>
                                        <li class="clearfix">
                                            <a href="javascript:;">
                                                <label class="dbcont content">暂无待办计划 </label><span class="time fr"></span>
                                            </a>
                                        </li><?php endif; ?>
                                </ul>
                                <ul class="list" style="display: none;">
                                    <li class="clearfix">
                                        <a href="javascript:;">
                                            <label class="dbcont content">暂无其他待办 </label><span class="time fr"></span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="section section5">
                        <h3 class="title">
                            <span class="active">工作计划</span>
                            <a href="<?php echo U('Plan/index',array('sms_flag'=>0,'type'=>4));?>" title="更多"><i class="iconfont fr">&#xe61b;</i></a>
                        </h3>
                        <div class="tabBox">   
                            <ul class="clearfix navList">
                                <?php if(is_array($planTypes)): foreach($planTypes as $key=>$type): ?><li class="<?php echo ($key == 0 ? 'active' : ''); ?>"><?php echo ($type["type_name"]); ?></li><?php endforeach; endif; ?>
                            </ul>
                            <div class="listBox">
                                <?php if(is_array($planTypes)): foreach($planTypes as $key=>$type): ?><ul class="list" <?php echo ($key > 0 ? 'style="display:none"' : ''); ?>>
                                        <?php if(!empty($type["plans"])): if(is_array($type["plans"])): foreach($type["plans"] as $key=>$plan): ?><li class="clearfix">
                                                    <a href="<?php echo U('Plan/show',array('id'=>$plan['plan_id'],'type'=>4,'sms_flag'=>0));?>" title="<?php echo ($plan["name"]); ?>">
                                                        <div class="content">
                                                            <?php if($plan['noRead'] == 1): ?><span class="dotted"></span><?php endif; ?>
                                                            <?php echo ($key+1); ?>. <?php echo ($plan["name"]); ?></div><span class="time fr"><?php echo ($plan["begin_date"]); ?></span>
                                                    </a>
                                                </li><?php endforeach; endif; ?>
                                            <?php else: ?>
                                            <li class="clearfix">暂无数据</li><?php endif; ?>
                                    </ul><?php endforeach; endif; ?>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="right">
                    <div class="section section7">
                        <h3 class="title">
                            <span class="active">最新动态</span>
                        </h3>
                        <ul class="clearfix">
                            <li><a href="<?php echo U('Flow/lists',array('type'=>1));?>" class="bg1">流程审批</a><span class="num bg1"><?php echo ($runCount); ?></span></li>
                            <li><a href="<?php echo U('Plan/index',array('sms_flag'=>0,'type'=>4));?>" class="bg2">工作计划</a><span class="num bg2"><?php echo ($planNoRead); ?></span></li>
                            <li><a href="<?php echo U('Personal/notice');?>" class="bg3">公告通知</a><span class="num bg3"><?php echo ($notifyNoRead); ?></span></li>
                            <li><a href="#" class="bg4 newEmail">电子邮件</a><span class="num bg4"><?php echo ($newCount); ?></span></li>
                            <li><a href="<?php echo U('Personal/news');?>" class="bg5">新闻动态</a><span class="num bg5"><?php echo ($newsNoRead); ?></span></li>
                            <li><a href="<?php echo U('Personal/email');?>" class="bg6">假期结余</a><span class="num bg6"><?php echo ($vacation); ?></span></li>
                        </ul>
                        <input type='hidden' id='loginEmail' value="<?php echo U('loginEamil');?>">
                    </div>
                    <div class="section section8">
                        <h3 class="title" style="margin:0"><span class="active">本月工作统计</span><input type="text" value="7月" class="month fr" readonly="readonly" /></h3>					
                        <div id="echart1"></div>
                    </div>
                    <div class="section section9">
                        <h3 class="title"><span class="active">自助查询</span></h3>
                        <div class="searchBox positionR">
                            <ul>
                                <li class="txlSearch"><i class="iconfont iconfont1">&#xe61e;</i>通讯录查询</li>
                                <li class="hysSearch"><i class="iconfont iconfont2">&#xe620;</i>会议室查询</li>
                            </ul>
                            <div class="inputWrap inputWrap1" style="display: none;overflow: auto">
                                <div class="inputBox active">
                                    <i class="iconfont">&#xe6b5;</i>
                                    <input type="text" placeholder="请输入员工姓名" class="name submitEnter" data-url="<?php echo U('enterSearch',array('table'=>'address'));?>"/>
                                </div>
                                <div class="list">
                                </div>
                            </div>
                            <div class="inputWrap inputWrap1" style="display: none;">
                                <div class="inputBox active active2">
                                    <i class="iconfont">&#xe6b5;</i>
                                    <input type="text" placeholder="暂未开放" class="name submitEnter" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" id="watherUrl" value="<?php echo U('getWather');?>" />
        <input type="hidden" id="echartsUrl" value="<?php echo U('getEchartsData');?>" />
        <input type="hidden" name="lng" value="" />
        <input type="hidden" name="lat" value="" />
        <input type="hidden" id="getFlowCountUrl" value="<?php echo U('getFlowCount');?>">
        <input type="hidden" id="getCalendarUrl" value="<?php echo U('getCalendar');?>">
        <input type="hidden" id="getRemindViewUrl" value="<?php echo U('getRemindView');?>">

        <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
        <script type="text/javascript">
            $(initIndex())
            $(function () {
                //鼠标移动显示在线人员
                $('.onlineUser').on('mouseover', function () {
                    $('.onlineList').fadeIn();
                }).on('mouseleave', function () {
                    $('.onlineList').fadeOut();
                })

                //鼠标移动显示未来三日天气
                $('.watherMore').on('mouseover', function () {
                    $('.after').fadeIn();
                }).on('mouseleave', function () {
                    $('.after').fadeOut();
                })

                //新增日程
                $(document).on("click", ".section3 .inseartEvent", function () {
                    var data = getCalendarDate();
                    var id = $(this).attr('data-id');
                    console.log(data);
                    var document_w = $(window).width();
                    var document_h = $(window).height();
                    var layer_w = '450';
                    var layer_h = '650';
                    var w = (document_w - layer_w) / 2;
                    var h = (document_h - layer_h) / 2;
                    layer.open({
                        type: 2,
                        title: [
                            "新建日程",
                            'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
                        ],
                        area: [layer_w + 'px', layer_h + 'px'], //宽高
                        offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
                        content: "/index.php/Home/Personal/event/date/" + data + '/id/' + id,
                    })
                });

                //点击日期显示日程
                $("#container .sc-item .day").on('click', function () {
                    var day = $(this).text();
                    var date = getCalendarDate(1) + '-' + day;
                    var url = $('#getCalendarUrl').val() + '?date='+date;
                    $.get(url,function(res){
                        console.log(res);
                        if(res){
                            var html = '';
                            for(var i=0; i<res.length; i++){
                                html += '<li class="clearfix"><a href="javascript:;" title="'+res[i].content+'"><i class="iconfont remindIcon">&#xe6c6;</i>';
                                html += '<label>&nbsp;'+res[i].remind_time+'</label>';
                                html += '<span>'+res[i].title+'</span>';
                                html += '<div class="fr operation"><i class="iconfont deliconfont delete" data-url="/index.php/Home/Personal/delCalendar/id/'+res[i].id+'">&#xe698;</i>';
                                html += '<i class="iconfont inseartEvent" data-id="'+res[i].id+'">&#xe636;</i></div></a></li>';
                            }
                        }
                        $('.remindList').html(html)
                    })
                })
                //写日志
                $(document).on("click", ".section3 .writeLog", function () {
                    var date = getCalendarDate();
                    var document_w = $(window).width();
                    var document_h = $(window).height();
                    var layer_w = '550';
                    var layer_h = '550';
                    var w = (document_w - layer_w) / 2;
                    var h = (document_h - layer_h) / 2;
                    layer.open({
                        type: 2,
                        title: [
                            "写日志",
                            'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
                        ],
                        area: [layer_w + 'px', layer_h + 'px'], //宽高
                        offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
                        content: "/index.php/Home/Index/layer/type/15/date/" + date
                    })
                });

                //获取插件中日期
                function getCalendarDate(type) {
                    var day = $("#container .sc-selected").find(".day").text();
                    if (day == '') {
                        day = $("#container .sc-today").find(".day").text();
                    }
                    var month = $("#container .sc-select-month").val();
                    var year = $("#container .sc-select-year").val()
                    if (type == 1) {
                        return year + '-' + month
                    } else {
                    return year + '-' + month + '-' + day;
                    }
                }

                //搜索人员
                $('.searchUser').bind('keypress', function (event) {
                    if (event.keyCode == "13") {
                        var url = $(this).attr('data-url') + '?name=' + $(this).val();
                        $.get(url, function (res) {
                            console.log(res);
                            if (res) {
                                var html = '<li class="item item-hide" state="hide"><a>';
                                html += '<span>' + res.attendType + '</span>';
                                html += '<label class="color1">1</label><em class="arrow"></em></a>';
                                html += '<dl><dd><img src="' + res.head + '" />';
                                html += '<span>' + res.username + '</span></dd></dl></li>';
                            } else {
                                var html = '<li class="item item-hide" state="hide"><a><span>该员工今天在岗</span></a></li>';
                            }
                            $('#stateBox .search-ul').show();
                            $('#stateBox .default').hide();
                            $('#stateBox .search-ul').html(html);
                        })
                    }
                })

                //鼠标移入显示用户
                $('.headIcon i').on('mouseover', function () {
                    $('#stateBox .search-ul').hide();
                    $('#stateBox .default').show();
                    $('.searchUser').val('');
                })
            });

            //提出问题与建议
            $('.question').click(function () {
                var document_w = $(window).width();
                var document_h = $(window).height();
                var layer_w = '550';
                var layer_h = '350';
                var w = (document_w - layer_w) / 2;
                var h = (document_h - layer_h) / 2;
                layer.open({
                    type: 2,
                    title: [
                        "问题与建议",
                        'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
                    ],
                    area: [layer_w + 'px', layer_h + 'px'], //宽高
                    offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
                    content: "/index.php/Home/Index/layer/type/19"
                })
            })
            //问题列表
            $('.questionList').click(function () {
                var document_w = $(window).width();
                var document_h = $(window).height();
                var layer_w = '550';
                var layer_h = '450';
                var w = (document_w - layer_w) / 2;
                var h = (document_h - layer_h) / 2;
                layer.open({
                    type: 2,
                    title: [
                        "问题与建议",
                        'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
                    ],
                    area: [layer_w + 'px', layer_h + 'px'], //宽高
                    offset: [h + 'px', w + 'px'], //弹出位置 [top,left]
                    content: "/index.php/Home/Index/layer/type/20"
                })
            })
        </script>
    </body>
</html>